var exec = require("cordova/exec");
var argscheck = require('cordova/argscheck');

module.exports = {
    createQRCodeImage: function(data,success) {
		typeof(data) !== 'object' && (data = {});
        typeof(success) !== 'function' && (success = function(mes) {})
        var getValue = argscheck.getValue;

		data.content = getValue(data.content, "");
		data.width = getValue(data.width, "480");
		data.height = getValue(data.height, "480");
		data.black = getValue(data.black, "#000000");
		data.white = getValue(data.white, "#FFFFFF");
		data.logo = getValue(data.logo, "");
		data.percent = getValue(data.percent, "0.2F");
		data.margin = getValue(data.margin, "2");

        exec(success,function(mes) {},"QRCodePlugin","createQRCodeImage",[data]);
    },
    richScanQRCode: function(data,success) {
		typeof(data) !== 'object' && (data = {});
        typeof(success) !== 'function' && (success = function(mes) {})

        exec(success,function(mes) {},"QRCodePlugin","richScanQRCode",[data]);
    }
}
